package eu.web.security.access;

import javax.servlet.http.HttpServletRequest;

public class IdentityFetcher {

	private static String sessionKey="eu.web.security.AccessIdentity";
	
	public static AccessIdentity fetch(HttpServletRequest r) {
		AccessIdentity aid= (AccessIdentity) r.getSession().getAttribute(sessionKey);
		if(aid==null){
			aid=new AccessIdentity();
			r.getSession().setAttribute(sessionKey, aid);
		}
		return aid;
	}
	
}
